package study.javaee.practice.result;


    public class JpaResultFactory {
        public static JpaResultcourse buildSuccessResult(Object data) {
            return buildResult(JpaResultCode.SUCCESS, "成功", data);
        }

        public static JpaResultcourse buildFailResult(String message) {
            return buildResult(JpaResultCode.FAIL, message, null);
        }

        public static JpaResultcourse buildResult(JpaResultCode resultCode, String message, Object data) {
            return buildResult(resultCode.code, message, data);
        }

        public static JpaResultcourse buildResult(int resultCode, String message, Object data) {
            return new JpaResultcourse(resultCode, message, data);
        }
    }

